package com.newproject.resmi;

import android.content.Intent;
import android.os.Bundle;
import android.preference.Preference;
import android.preference.PreferenceActivity;
import android.preference.Preference.OnPreferenceClickListener;
 
public class UserPreferences extends PreferenceActivity {
		
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
	    addPreferencesFromResource(R.xml.preferences);
	    
//	    final CheckBoxPreference prefRememberLogin = (CheckBoxPreference) findPreference("prefRememberLogin");
//	    prefRememberLogin.setOnPreferenceClickListener(new OnPreferenceClickListener() {
//	        public boolean onPreferenceClick(Preference preference) {
//	        	SharedPreferences settings = getSharedPreferences(USER_DETAILS, Context.MODE_PRIVATE);
//	        	SharedPreferences.Editor editor = settings.edit();
//	        	if (prefRememberLogin.isChecked()) {		        	
//					editor.putBoolean("prefRememberLogin", true);				    
//	        	} else {
//					editor.putBoolean("prefRememberLogin", false);
//	        	}
//	        	editor.commit();
//				return true;	            
//	        }
//	    });    
	    	    
	    Preference prefChangePassword = (Preference) findPreference("prefChangePassword");
	    prefChangePassword.setOnPreferenceClickListener(new OnPreferenceClickListener() {	 
		    public boolean onPreferenceClick(Preference preference) {
			    Intent newIntent = new Intent(UserPreferences.this, ChangePassword.class);
			    UserPreferences.this.startActivity(newIntent);
			    return true;
		    }	 
	    });
	    
//	    ListPreference prefUpdatePeriod = (ListPreference) findPreference("prefUpdatePeriod");
//	    prefUpdatePeriod.setOnPreferenceClickListener(new OnPreferenceClickListener() {	 
//		    public boolean onPreferenceClick(Preference preference) {
//			    
//			    return true;
//		    }	 
//	    });
    }
}